const db = require('../config/db');

const userModel = '../schema/users.js';

const Mall = db.MallSequelize;

const User = Mall.import(userModel);


const login = async function (data) {
    const result = await User.findOne({
        where: {
            user_name: data.userName,
            password: data.password
        }
    })
    return result;
}

const regesiter = async function (data){
    const result  = await User.create({
        user_name: data.userName,
        password: data.password
    })
    return true
}
module.exports = {
    login,
    regesiter
}